<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="common.css">
    <title>Vue入门指南——from表单绑定</title>
    <script type="importmap">
        {
            "imports":{
                "vue":"https://lib.baomitu.com/vue/latest/vue.esm-browser.js"

            }
        }
    </script>
</head>
<body>
    <div id="app">
        <p>
            <input type="text" placeholder="输入文本" :value="text"
                @input="event => text = event.target.value" >
                <span>{{text}}</span>
        </p>
        <p><input type="text" placeholder="单行文本" v-model="msg1">{{msg1}}</p>
        <p>
            <textarea name="" id="" cols="30" rows="10" placeholder="多行文本" v-model="msg2"></textarea>
            <pre>{{msg2}}</pre>
        </p>
        <p>
            <input type="checkbox" name="" id="cb1" v-model="checked">
            <label for="cb1">{{checked}}</label>
        </p>
        <p>
            <span>选中项：{{}}</span>
        </p>
    </div>
    <script type="module">
        import{createApp} from "vue";

        createApp({
            data(){
                return{
                    text:"",
                    msg1:"",
                    msg2:"",
                    checked:true,
                    checkedNames:[],
                };
            }
        }).mount("#app");

    </script>
</body>
</html>